package com.platform.server.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.platform.server.dao.DiscountDao;
import com.platform.server.dao.RoyaltyDao;
import com.platform.server.service.DiscountService;

@Service
public class DiscountServiceImpl implements DiscountService {

	@Autowired
	private DiscountDao discountDao;

	/**
	 * 设置优惠券张数
	 */
	@Override
	public int updateDiscontNum(String common_discount_id, String five_ticket, String ten_ticket, String twenty_ticket,
			String fifty_ticket, String hundred_ticket, String count_money) {
		Map<String,Object> map = new HashMap<>();
		map.put("common_discount_id", common_discount_id);
		map.put("five_ticket", five_ticket);
		map.put("ten_ticket", ten_ticket);
		map.put("twenty_ticket", twenty_ticket);
		map.put("fifty_ticket", fifty_ticket);
		map.put("hundred_ticket", hundred_ticket);
		map.put("count_money", count_money);
		return discountDao.updateDiscontNum(map);
	}

	/**
	 * 设置普通优惠券
	 */
	@Override
	public int setCommontDiscount(Map<String, Object> map) {
		return discountDao.setCommontDiscount(map);
	}
	
	/**
	 * 查看充值面额
	 */
	@Override
	public List<Map<String, Object>> selectRechargeSet() {
		return discountDao.selectRechargeSet();
	}

	/**
	 * 设置充值面额
	 */
	@Override
	public int rechargeSet(String five_ticket, String ten_ticket, String twenty_ticket, String fifty_ticket,String hundred_ticket) {
		Map<String,Object> map = new HashMap<>();
		map.put("five_ticket", five_ticket);
		map.put("ten_ticket", ten_ticket);
		map.put("twenty_ticket", twenty_ticket);
		map.put("fifty_ticket", fifty_ticket);
		map.put("hundred_ticket", hundred_ticket);
		return discountDao.rechargeSet(map);
	}

	/**
	 * 查看活动优惠券设置
	 */
	@Override
	public List<Map<String, Object>> selectActivityDiscount() {
		return discountDao.selectActivityDiscount();
	}

	/**
	 * 设置活动优惠券张数
	 */
	@Override
	public int updateActivityDiscontNum(String activity_discount_id, String five_ticket, String ten_ticket,
			String twenty_ticket, String fifty_ticket, String hundred_ticket, String count_money) {
		Map<String,Object> map = new HashMap<>();
		map.put("activity_discount_id", activity_discount_id);
		map.put("five_ticket", five_ticket);
		map.put("ten_ticket", ten_ticket);
		map.put("twenty_ticket", twenty_ticket);
		map.put("fifty_ticket", fifty_ticket);
		map.put("hundred_ticket", hundred_ticket);
		map.put("count_money", count_money);
		return discountDao.updateActivityDiscontNum(map);
	}

	/**
	 * 设置活动优惠券
	 */
	@Override
	public int setActivityDiscount(Map<String, Object> map) {
		return discountDao.setActivityDiscount(map);
	}

}
